All Functions of Week 5

factor

{base}

Create factor variables

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

cut

{base}

Convert Numeric to Factor

slice

{dplyr}

Select rows by position

install.packages

{utils}

Install R packages

arrange

{dplyr}

Sort values of data frame according to a variable/combination of variables

mean

{base}

Get mean of a vector

read_excel

{readxl}

Read an Excel file

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

desc

{dplyr}

Arrange in descending order

factor

{base}

Create a factor

setwd

{base}

Set Working Directory

names

{base}

Get or set names of an object

str

{utils}

Get the structure of an R object

select

{dplyr}

Select columns from a tibble/data frame

View

{base}

View a data frame

recode

{dplyr}

Recode a variable

library

{base}

Load an R package

mutate

{dplyr}

Create new variables

install_rsthemes

{rsthemes}

Install the rsthemes collection of RStudio themes

c

{base}

Combine values/vectors into a vector

levels

{base}

Get levels of a factor

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

with

{base}

evaluate expression in the context of a data frame

order

{base}

Get indexes that will sort a vector

head

{utils}

Show first 5 rows of a data frame

aggregate

{stats}

Compute summary statistics of data subsets / by groups

recode_factor

{dplyr}

Recode factor values, changing the levels and their order

ifelse

{base}

Return a or b depending on the value of test

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

ungroup

{dplyr}

Resolve grouping created with “group_by”

filter

{dplyr}

Filter out rows of a data frame according to logical vector

The end!